package Practice.String;

public class IndexOfDemo {
    public static void main(String[] args) {
        //                    1111111111222
        //          01234567890123456789012
        String s = "boy next door,as we can";
        int index = s.indexOf("oo");
        System.out.println(index);
        int index1 = s.indexOf("o",12);
        System.out.println(index1);//-1没有就返回-1
        int index2 = s.lastIndexOf("a");
        System.out.println(index2);




    }
}
